package com.teamclub.util.libs;

import com.google.common.base.Joiner;

import java.util.Map;
import java.util.TreeMap;

/**
 * Created by ilkkzm on 17-5-17.
 */
public class SignatureUtil {
    public SignatureUtil() {
    }

    public static String sign(Map<String, String> map, String key) {
        TreeMap<String, String> treemap = new TreeMap<String, String>(map);
        String str = Joiner.on("&").withKeyValueSeparator("=").join(treemap);
        str = str + "&key=" + key;
        return MD5.md5Hex(str).toUpperCase();
    }
}
